/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.namabank.helpdesk.model;

import com.namabank.helpdesk.dbobj.HDTB_TICKET;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 *
 * @author Nguyen Tran Hien
 */
public class HelpdeskTicketModel {
    public HelpdeskTicketModel(HDTB_TICKET obj){
        hdtbTicketObj = obj;
    }

    /**
     * Kiểm tra tính hợp lệ của ticket
     * @return
     */
    public JSONArray validate(){
        JSONArray arr = new JSONArray();
        if(hdtbTicketObj == null){
            JSONObject json = new JSONObject();
            try {
                json.put("error_param", "hdtbTicketObj");
                json.put("error_type", "null");
                json.put("error_desc", "Không có record HDTB_TICKET");
            } catch (JSONException ex) {
            }
            arr.put(json);
            return arr;
        }

        UserModel userModel = UserModel.getInstance(hdtbTicketObj.getUSER_REQUEST());

        return arr;
    }
    private HDTB_TICKET hdtbTicketObj;

}
